s
<template>
  <div>
    <div class="headers">
      <div class="logo">
        <img src="../common/image/logo.png" alt="" />
      </div>
      <div class="user_message">
        <div class="message_icon">
          <div class="con_header_button">
            <span class="title">当前项目</span>
            <span class="content">test</span>
            <span @click="clickDraw" class="button">切换项目</span>
          </div>
          &nbsp;&nbsp;
        </div>
        <span class="span_x"> | </span>
        <el-dropdown trigger="click">
          <div class="user_img">
            <el-icon :size="20"><User /></el-icon>
            <span class="user_text">userName</span>
          </div>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="resetPassword()"
                >重置密码</el-dropdown-item
              >

              <el-dropdown-item @click="exit()">退出登录</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
    <el-drawer v-model="drawer" :with-header="true" class="drawer_user">
      <template #header="{ titleId }">
        <div
          :id="titleId"
          style="font-weight: bold; color: #212121; font-size: 24px"
        >
          切换项目
        </div>
      </template>
      <template #default> 这里请求项目列表 </template>
    </el-drawer>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
import { Search } from "@element-plus/icons-vue";

import { ref, onMounted, onBeforeUnmount } from "vue";

onBeforeUnmount(() => {});

onMounted(() => {});

let router = useRouter();
let exit = () => {
  sessionStorage.clear();
  // 跳转到登录页面
  router.replace({ name: "login" });
};

let resetPassword = () => {
  // 跳转到重置密码页面
};

let drawer = ref(false);
let clickDraw = () => {
  drawer.value = true;
};
</script>

<style scoped lang="less">
/deep/ .box-card {
  .el-card__body {
    padding: 0px;
  }
}
.user_text {
  margin-left: 4px;
  font-size: 16px;
  font-family: Microsoft YaHei-Regular;
}
.user_img {
  margin-left: 10px;
  display: flex;
  align-items: center;
  color: #f5f5f5;
}

.con_header_button {
  margin-left: 30px;

  .button {
    cursor: pointer;
    font-size: 16px;
    font-family: Microsoft YaHei-Regular, Microsoft YaHei;
    font-weight: 400;
    color: rgb(24, 144, 255);
  }

  .content {
    margin-right: 15px;

    font-family: Microsoft YaHei-Bold, Microsoft YaHei;
    font-weight: bold;
    color: white;
  }

  .title {
    margin-right: 15px;
    font-family: Microsoft YaHei-Regular, Microsoft YaHei;
    font-size: 16px;
    font-weight: 400;
    color: #707070;
  }
}
.message_icon {
  display: flex;
  align-items: center;
  position: relative;
  justify-content: center;
  margin-right: 10px;
}
.user_message {
  display: flex;
  align-items: center;

  color: #f5f5f5;
}
.headers {
  width: 100%;
  padding: 5px 10px;
  background: #353338;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img {
  width: 300px;
}

.card-header {
  font-size: 17px;
  margin-bottom: 10px;
  font-weight: bold;
}

.message_icon {
  /deep/ .el-popover {
    padding: 0 !important;
  }
}
</style>
